Dynomotion

Group: DynoMotion Message: 7565 From: darrengladysz Date: 6/1/2013
Subject: Master/slave questions
Hi Tom,

Sorry for the long list of questions, but I accumulated these and could not find an answer for these.

I am using kflop and kanalaog with a 3 axis gantry cnc router where axis 3 is slaved to axis 0. All axis are ac servos with encoders.

I am having problems getting the master/slave to work together. I am using the latest 4.30 which I downloaded last week from the dynomotion site.

A few questions:

1. In the sample Init3Analog.c file. Do I need the define QA and QB as well as the variables int BitA .. double Factor=0? What are these for? What other variables would I need in the init.c other than axis definitions and setting bits to enable the axis outputs and drives?

2. Do I enable axis 3 which is slaved to axis 0 in the init.c file?

3. Do I Set DefineCoorSystem as 0,1,2,-1 ? or do I add axis 3. I recall from a post that you state not to include axis 3 as it may lead to strange things.

4. How do I know what minor version of 4.30 I am using? I understand there were issues with 4.30g for master/slave but you gave a link to a 4.30h. Is the version on the download page 4.30 h or later and if so does it include the fix for master/slave in 4.30 h?

5. Is it important to set all the axis at position 0 in the init.c (I have not gotten around to setting up homing yet)? Can it be that axis 0 and axis3 have different positions on startup and this may cause a problem? Can I use Pos<N>=<P> to set both axis 0 and 3 to zero and include this in my init.c file for testing purposes? Once I get to homing I presume that is where you then set the axis position to 0 or whatever other value I choose in the homing.c file.

6. In kmotion, is there a way to slave axis 0 and axis 3 to test them? If not, how do you test the master/slave axis to set the pid values? I can test one side but the other side drags which most likely leads to false results.

7. Do you have a step by step guide or a more detailed post or link for how to set up the init.c file? I understand the general idea but the subtleties and exceptions are where I am getting stuck at times.

8. I am using dac7 as spindle output with NOINPUT and DACSERVO as output. This is connected to a vfd drive that is running open loop for the spindle and taking a +-10v signal. Do I need to enable axis 7 in the init.c file? Do I need to provide the axis configuration in the init.c file - there is no need for pid or limits etc.?

9. To turn the spindle on, I presume that I issue a GCODE G97 S1024 command for full spindle speed if I set up my spindle for 0 to 1024 resolution in kmotioncnc toolsetup?

10. Lastly (for now) I plan to use some Hamlim 55110 led hall proximity sensors as limit and homing switch - two per axis so a total of 8 (datasheet link: http://www.hamlin.com/specsheets/55110%20IssueAE.pdf) and plan to use these with kanalog jp12 3.3v inputs as + and - limit switches. Each require 20ma to work and need at least 3.8v so I would be using vdd5 as power and connecting the other end (the blue out wire) to jp12 inputs which are 3.3v. Will the onboard vdd5 be sufficient or should I connect to the 5v power supply? Will putting a 200 ohm series resistor with the input be all that is required as the inputs are 3.3v? I am still learning about pull-up pull-down resistors. Are any of these needed?

Thanks in advance for the information.

Darren
Group: DynoMotion Message: 7566 From: Tom Kerekes Date: 6/1/2013
Subject: Re: Master/slave questions
Hi Darren,

See below:

Group: DynoMotion Message: 7567 From: darrengladysz Date: 6/1/2013
Subject: Re: Master/slave questions
Thank you Tom for the quick and thorough responses.

I will be implementing the homing of the gantry and using the Hamlin 55110 hall sensors for this. The fun part should be in positioning these to be perfectly square and I am designing an adjustable mount for these (at least the magnet part of it). Guess I need to use a big square or maybe some lasers and mirrors to make sure the gantry is perpendicular to the x axis.

Regards and thanks again,

Darren

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Darren,
>
> See below:
>
>
>
> ________________________________
> From: darrengladysz <dgladysz@...>
> To: DynoMotion@yahoogroups.com
> Sent: Saturday, June 1, 2013 6:35 PM
> Subject: [DynoMotion] Master/slave questions
>
>
>
>  
> Hi Tom,
>
> Sorry for the long list of questions, but I accumulated these and could not find an answer for these.
>
> I am using kflop and kanalaog with a 3 axis gantry cnc router where axis 3 is slaved to axis 0. All axis are ac servos with encoders.
>
> I am having problems getting the master/slave to work together. I am using the latest 4.30 which I downloaded last week from the dynomotion site.
>
> A few questions:
>
> 1. In the sample Init3Analog.c file. Do I need the define QA and QB as well as the variables int BitA .. double Factor=0? What are these for? What other variables would I need in the init.c other than axis definitions and setting bits to enable the axis outputs and drives?
> >>Those are used or leftover from software MPG A B Encoder signals.
>
> 2. Do I enable axis 3 which is slaved to axis 0 in the init.c file?
> >>Yes
>
> 3. Do I Set DefineCoorSystem as 0,1,2,-1 ? or do I add axis 3. I recall from a post that you state not to include axis 3 as it may lead to strange things. 
> >>Leave out any Slaved Axes.
>
> 4. How do I know what minor version of 4.30 I am using? I understand there were issues with 4.30g for master/slave but you gave a link to a 4.30h. Is the version on the download page 4.30 h or later and if so does it include the fix for master/slave in 4.30 h?
> >>The lettered Versions (4.30g. 4.30h, ...) are test releases before the Released Version of 4.30.  Please use the Released Version of 4.30 which should contain all those fixes.  To Check what Version you are running Right Click the title bar of KMotionCNC and select About.
>
>
> 5. Is it important to set all the axis at position 0 in the init.c (I have not gotten around to setting up homing yet)? Can it be that axis 0 and axis3 have different positions on startup and this may cause a problem? Can I use Pos<N>=<P> to set both axis 0 and 3 to zero and include this in my init.c file for testing purposes? Once I get to homing I presume that is where you then set the axis position to 0 or whatever other value I choose in the homing.c file.
> >>It is up to you to determine how your system is to operate.  It is not necessary to zero the positions in the Init Program.  The Master and The Slave do not necessarily have to be at the same position.  Once Slaved when the Master moves the Slave will move by the same amount (assuming a Slave Gain=1.0).  I would think you rally need some means of Homing/Squaring the axes.  Otherwise you will have an unknown amount of twisting/binding between the axes.  And this might change or accumulate every time you power cycle the system.  
> One approach is to Initialize each of the axis with a Destination equal to the current encoder position.  This will result in the axis remaining where it is:
> EnableAxisDest(0,ch0->Position);
>
> Then before Slaving Jog both axis toward home and stop each independently on separate home switches to square up the axes.
>
>
> 6. In kmotion, is there a way to slave axis 0 and axis 3 to test them? If not, how do you test the master/slave axis to set the pid values? I can test one side but the other side drags which most likely leads to false results.
> >>Yes in KMotion select/deselect the Slave options for the Slave and download the parameters.  When tuning the Master axis have the axes slaved so the Slave is following along rather than dragging/binding.  Usually the axis are similar so you can use the same tuning on both sides.  if you need to tune the Slave axis independently the temporarily reverse the roles of the Master and Slave.
>
> 7. Do you have a step by step guide or a more detailed post or link for how to set up the init.c file? I understand the general idea but the subtleties and exceptions are where I am getting stuck at times.
> >>No unfortunately the steps depend on the components in your system.
>
>
> 8. I am using dac7 as spindle output with NOINPUT and DACSERVO as output. This is connected to a vfd drive that is running open loop for the spindle and taking a +-10v signal. Do I need to enable axis 7 in the init.c file? Do I need to provide the axis configuration in the init.c file - there is no need for pid or limits etc.?
> >>To just open loop command of a DAC no Axis channel is required at all.
>
>
> 9. To turn the spindle on, I presume that I issue a GCODE G97 S1024 command for full spindle speed if I set up my spindle for 0 to 1024 resolution in kmotioncnc toolsetup? 
> >>Normally the S value is the desired RPM.  So determine the appropriate scale factor to convert the S RPM value to the required DAC setting.  The Max DAC value is actually 2047 thatoutputs 10V.  So for example if 10V runs your spindle at its max speed of 1000RPM.  Then a factor of 2.047 coule be used.  S Value of 1000 x 2.047 = 2047 DAC counts = 10V = 1000RPM.  KMotionCNC does constant Spindle speed by default.  G97 is not needed or accepted.
>
> 10. Lastly (for now) I plan to use some Hamlim 55110 led hall proximity sensors as limit and homing switch - two per axis so a total of 8 (datasheet link: http://www.hamlin.com/specsheets/55110%20IssueAE.pdf) and plan to use these with kanalog jp12 3.3v inputs as + and - limit switches. Each require 20ma to work and need at least 3.8v so I would be using vdd5 as power and connecting the other end (the blue out wire) to jp12 inputs which are 3.3v. Will the onboard vdd5 be sufficient or should I connect to the 5v power supply? Will putting a 200 ohm series resistor with the input be all that is required as the inputs are 3.3v? I am still learning about pull-up pull-down resistors. Are any of these needed?
> >>Those should work at +5V.  I don't think you will even need a series resistor because those only source a small current (0.1ma)and they only guarantee the output to go to 3V.  To be completely safe you could add the 200 ohms series resistor.  You could check the output voltage and if it doesn't go above 3.8V you don't need any resistor.
> HTH
> Regards
> TK
>
> Thanks in advance for the information.
>
> Darren
>